package excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * 读文件需要创建这个监听类确定读操作的具体操作
 */
public class EasyExcelLisnter extends AnalysisEventListener<DataDemo> {
    /**
     * 读文件时候的操作
     * 一行一行读
     * @param dataDemo
     * @param analysisContext
     */
    @Override
    public void invoke(DataDemo dataDemo, AnalysisContext analysisContext) {
        System.out.println("dataDemo:"+dataDemo);
    }

    /**
     * 读取文件表头
     * @param headMap
     * @param context
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息:" + headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
